//
//  TWVideoCollectionOfHorizontalScrollCardCell.swift
//  EyepetizerImitative
//
//  Created by 田伟 on 2017/4/11.
//  Copyright © 2017年 个人. All rights reserved.
//

import UIKit

protocol VideoCollectionOfHorizontalScrollCardCellDelegate {
    func horizontalScrollCardCellTitleDidClick(model : TWVideoCollectionOfHorizontalScrollCardModel)
}

class TWVideoCollectionOfHorizontalScrollCardCell: UITableViewCell {

    @IBOutlet weak var topView: UIView!
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var sunTitleLabel: UILabel!
    @IBOutlet weak var attentionButton: UIButton!
    @IBOutlet weak var bottomCollectionView: TWDetailCollectionView!
    @IBAction func horizontalScrollCardCellTitleClick() {
        horizontalScrollCardCellDelegate?.horizontalScrollCardCellTitleDidClick(model: model!)
    }
    var model : TWVideoCollectionOfHorizontalScrollCardModel?{
        didSet {
            guard let model = model else {
                return
            }
            titleLabel.text = model.header?.title
            sunTitleLabel.text = model.header?.subTitle
            
            // 设置detailCollectionView的内容
            bottomCollectionView.videosArray = model.itemList_tw
        }
    }
    var horizontalScrollCardCellDelegate : VideoCollectionOfHorizontalScrollCardCellDelegate?
    
    override func awakeFromNib() {
        super.awakeFromNib()
        attentionButton.layer.masksToBounds = true
        attentionButton.layer.cornerRadius = 4
        attentionButton.layer.borderWidth = 1
        attentionButton.layer.borderColor = UIColor.black.cgColor
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
